From: Keir Fraser Date: Wed, 22 Sep 2010 07:49:09 +0000 (+0100) Subject: Revert 22186:7167d6dd5c7c "x86: Retry do_mmu_update() a few times" X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11449 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=3bbed81e3005270423cc4047fb19c1ac90825548;p=xen.git Revert 22186:7167d6dd5c7c "x86: Retry do_mmu_update() a few times" It does not work reliably for a couple of reasons: (1) page_lock() fails if a page is !PGT_validated, and a page can remain in that state for unbounded time. (2) in the kernel-side race that motivated this patch, pgd_pin() can lose to vmalloc_sync_all() -- pgd_pin() can try to chaneg a pmd page's type to l2_pagetable while vmalloc_sync_all()->set_pmd()->do_mmu_update() has it temporarily pinned as writable. This is hard to fix on the Xen side. Hence I give up on this approach, revert the patch, and settle for kernel-side patching only. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index b75763b5bc..96344db47e 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -3414,7 +3414,6 @@ int do_mmu_update( case MMU_NORMAL_PT_UPDATE: case MMU_PT_UPDATE_PRESERVE_AD: { - unsigned int retries = 0; p2m_type_t p2mt; rc = xsm_mmu_normal_update(d, pg_owner, req.val); @@ -3446,7 +3445,6 @@ int do_mmu_update( (unsigned long)(req.ptr & ~PAGE_MASK)); page = mfn_to_page(mfn); - retry: if ( page_lock(page) ) { switch ( page->u.inuse.type_info & PGT_type_mask ) @@ -3603,11 +3601,6 @@ int do_mmu_update( v, va, req.val, _mfn(mfn)); put_page_type(page); } - else if ( retries++ < 5 ) - { - /* Page type can be in flux, so we retry a few times. */ - goto retry; - } unmap_domain_page_with_cache(va, &mapcache); put_page(page);